﻿#include <QtGui/QApplication>
#include "../comm/qtsingleapplication/qtsingleapplication.h"
#include "mymainwindow.h"

int main(int argc, char *argv[])
{
	QString msg("-show");
	if( argc>= 2 ) 
	{
		msg = QString::fromLocal8Bit(argv[1]).trimmed();
		if (msg==QString("-version"))
		{
			return 0;
		}
	}

	QtSingleApplication app("db_cfg", argc, argv);

	if (app.isRunning())
	{
		bool sentok = app.sendMessage(msg, 2000);
		return  0;
	}

    MyMainWindow w;
    w.show();
    return app.exec();
}
